<?php
class Application_Form_Area extends Zend_Form
{ 
    public function init()
    {
        $this->setName('area');
        $area = new Zend_Form_Element_Text ('nombre_area');
        $area->setLabel('Nombre Area:');
        $area->setRequired(true);
        $area->setAttrib('maxlength','30');
        $area->setErrorMessages(array('messages' => 'El campo Nombre Area solo puede contener letras'));
        $area->setAttrib('size', 10);
        $area->addDecorator('ViewHelper')  
            ->addDecorator('Errors')  
            ->addDecorator('HtmlTag', array('tag' => 'td'))  
            ->addDecorator('Label', array('tag' => 'dth'));
        
        $nivel = new Zend_Form_Element_Select('nivel');
        $nivel->setLabel('Nivel Area:')
            ->addMultiOptions(array(
                1 => 'Area',
                2 => 'Sub Area',
                        ));  
        $nivel->setRequired(true);
        $nivel->addDecorator('ViewHelper')  
            ->addDecorator('Errors')  
            ->addDecorator('HtmlTag', array('tag' => 'td'))  
            ->addDecorator('Label', array('tag' => 'dth'));
       
        $submit = new Zend_Form_Element_Submit('bCrearArea');
        $submit->setLabel('Crear Area:');
        
        $this->addElements(array($area, $nivel, $submit));

    }
 
}